<?php
header('Access-Control-Allow-Origin:*'); 
/**
 * 封装数据库查询操作
 */
require ("connect.php");
function MQuery($sqlwords){
    $rs = mysqli_query(Conn(),$sqlwords);
    return $rs;
}

function Mgetall($sqlwords){
    $data = array();
    $rs = MQuery($sqlwords);
    while($row = mysqli_fetch_assoc($rs)){
        $data[]=$row;
    }
    return $data;
}

function Mgetrow($sqlwords){
    $rs = Mquery($sqlwords);
    return mysqli_fetch_assoc($rs);
}

function Mgetone($sqlwords){
    $rs=MQuery($sqlwords);
    return mysqli_fetch_row($rs)[0];
}

?>